#include<iostream>
#include<functional>

class A
{
public:
	A(void)
	{
		func_test[0] = std::bind(&A::fadd, this, std::placeholders::_1, std::placeholders::_2);
		func_test[1] = std::bind(&A::fsub, this, std::placeholders::_1, std::placeholders::_2);
	}
	void SelfTest(void)
	{
		for (int i = 0; i < 10; i++)
		{
			if (nullptr != func_test[i])
			{
				func_test[i](1234, 5678);
			}
		}
	}

private:
	void fadd(int a, int b)
	{
		std::cout << a + b << std::endl;
	}
	void fsub(int a, int b)
	{
		std::cout << a - b << std::endl;
	}
	std::function<void(int, int)> func_test[10]{ nullptr, };
};

int main(void)
{
	A ca;
	ca.SelfTest();
}
